package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the PLACE_WORK database table.
 * 
 */
@Entity
@Table(name="PLACE_WORK")
@NamedQuery(name="PlaceWork.findAll", query="SELECT p FROM PlaceWork p")
public class PlaceWork implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="PLACE_WORK_GZDDID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="PLACE_WORK_GZDDID_GENERATOR")
	@Column(name="GZDD_ID")
	private long gzddId;

	@Column(name="GZDD_CTIME")
	private Timestamp gzddCtime;

	@Column(name="GZDD_NAME")
	private String gzddName;

	@Column(name="GZDD_PERSON")
	private String gzddPerson;

	@Column(name="GZDD_REMARK")
	private String gzddRemark;

	@Column(name="GZDD_STATE")
	private BigDecimal gzddState;

	@Column(name="GZDD_UTIME")
	private Timestamp gzddUtime;

	//bi-directional many-to-one association to OrganizationArea
	@ManyToOne
	@JoinColumn(name="ORGAREA_ID1")
	private OrganizationArea organizationArea;

	//bi-directional many-to-one association to Worksheet
	@OneToMany(mappedBy="placeWork")
	@JSONField(serialize=false)
	private List<Worksheet> worksheets;

	public PlaceWork() {
	}

	public long getGzddId() {
		return this.gzddId;
	}

	public void setGzddId(long gzddId) {
		this.gzddId = gzddId;
	}

	public Timestamp getGzddCtime() {
		return this.gzddCtime;
	}

	public void setGzddCtime(Timestamp gzddCtime) {
		this.gzddCtime = gzddCtime;
	}

	public String getGzddName() {
		return this.gzddName;
	}

	public void setGzddName(String gzddName) {
		this.gzddName = gzddName;
	}

	public String getGzddPerson() {
		return this.gzddPerson;
	}

	public void setGzddPerson(String gzddPerson) {
		this.gzddPerson = gzddPerson;
	}

	public String getGzddRemark() {
		return this.gzddRemark;
	}

	public void setGzddRemark(String gzddRemark) {
		this.gzddRemark = gzddRemark;
	}

	public BigDecimal getGzddState() {
		return this.gzddState;
	}

	public void setGzddState(BigDecimal gzddState) {
		this.gzddState = gzddState;
	}

	public Timestamp getGzddUtime() {
		return this.gzddUtime;
	}

	public void setGzddUtime(Timestamp gzddUtime) {
		this.gzddUtime = gzddUtime;
	}

	public OrganizationArea getOrganizationArea() {
		return this.organizationArea;
	}

	public void setOrganizationArea(OrganizationArea organizationArea) {
		this.organizationArea = organizationArea;
	}

	public List<Worksheet> getWorksheets() {
		return this.worksheets;
	}

	public void setWorksheets(List<Worksheet> worksheets) {
		this.worksheets = worksheets;
	}

	public Worksheet addWorksheet(Worksheet worksheet) {
		getWorksheets().add(worksheet);
		worksheet.setPlaceWork(this);

		return worksheet;
	}

	public Worksheet removeWorksheet(Worksheet worksheet) {
		getWorksheets().remove(worksheet);
		worksheet.setPlaceWork(null);

		return worksheet;
	}

}